package com.atmilan.quartz.sync.pull.daigo.service.impl;

import com.atmilan.quartz.model.entity.daigo.DaigoBrand;
import com.atmilan.quartz.model.entity.daigo.DaigoSeason;
import com.atmilan.quartz.sync.pull.daigo.mapper.DaigoBrandMapper;
import com.atmilan.quartz.sync.pull.daigo.mapper.DaigoSeasonMapper;
import com.atmilan.quartz.sync.pull.daigo.service.IDaigoBrandService;
import com.atmilan.quartz.sync.pull.daigo.service.IDaigoSeasonService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class DaigoSeasonServiceImpl extends ServiceImpl<DaigoSeasonMapper, DaigoSeason> implements IDaigoSeasonService {

     @Override
    public DaigoSeason getSeasonByName(String name) {
        QueryWrapper<DaigoSeason> qw = new QueryWrapper<>();
        qw.lambda().eq(DaigoSeason::getDaigoSeasonCode,name);
        DaigoSeason daigoBrand = this.getOne(qw);
        return daigoBrand;
    }
}
